<style type="text/css" media="screen">
    .empty{
        color:red;
        position: relative;
        top: 9px;
    }
    .layui-select-disabled .layui-disabled{
    	color:#666 !important;
    }
    .layui-disabled, .layui-disabled:hover{
    	color:#666 !important;
    }
</style>

<div class="layui-form" id="layuiadmin-form-admin" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <div class="layui-row">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>
                <b>
                    基本信息
                </b>
            </legend>
        </fieldset>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    获得时间
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" id="period" name="get_customer_time" value="{$model.get_customer_time??''}" placeholder="请输入获得客户时间" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    负责人
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="person_in_charge" placeholder="请输入负责人,为空时默认自己" value="{$model.PersonInCharge.nickname ??''}" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>
                <b>
                    公司信息
                </b>
            </legend>
        </fieldset>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户名称
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="customer_name" value="{$model.customer_name??''}" placeholder="请输入客户名称" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    所在城市
                </label>
                <div class="layui-input-block">
                    <select name="city" disabled>
                        <option value="">请选择城市</option>
                        {foreach $customer_city as $key=>$vo}
                            <option value="{$vo.id}" {if condition="($model.city_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    行业
                </label>
                <div class="layui-input-block">
                    <select name="industry" disabled>
                        <option value="">请选择行业</option>
                        {foreach $industry as $key=>$vo}
                            <option value="{$vo.name}" {if condition="($model.industry_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    意向产品
                </label>
                <div class="layui-input-block">
                    <select name="intention" disabled>
                        <option value="">请选择意向产品</option>
                        {foreach $intention as $key=>$vo}
                              <option value="{$vo.name}" {if condition="($model.intention_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    公司座机
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" value="{$model.plane ?? ''}" name="plane" placeholder="请输入公司座机" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户状态
                </label>
                <div class="layui-input-block">
                    <select name="customer_status" disabled>
                        <option value="">请选择客户状态</option>
                        {foreach $customer_status as $key=>$vo}
                             <option value="{$vo.name}" {if condition="($model.customer_status_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户类别
                </label>
                <div class="layui-input-block">
                    <select name="customer_type" disabled>
                        <option value="">请选择客户类别</option>
                        {foreach $customer_type as $key=>$vo}
                             <option value="{$vo.id}" {if condition="($model.customer_type_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户等级
                </label>
                <div class="layui-input-block">
                    <select name="customer_level" disabled>
                        <option value="">请选择客户等级</option>
                        {foreach $customer_level as $key=>$vo}
                              <option value="{$vo.id}" {if condition="($model.customer_level_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户来源
                </label>
                <div class="layui-input-block">
                    <select name="customer_source" disabled>
                        <option value="">请选择客户来源</option>
                        {foreach $customer_source as $key=>$vo}
                             <option value="{$vo.id}" {if condition="($model.customer_source_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    成熟度
                </label>
                <div class="layui-input-block">
                    <select name="maturity" disabled>
                        <option value="">请选择成熟度</option>
                        {foreach $customer_ripe as $key=>$vo}
                        <option value="{$vo.id}" {if condition="($model.maturity_id eq $vo.id)" }selected{/if}>{$vo.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    地址
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="address" value="{$model.address ?? ''}" placeholder="请输入地址" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户介绍
                </label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" id="LAY_demo_editor" lay-verify="remarks" name="remarks" readonly>{$model.remarks ?? ''}</textarea>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md12">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    相关附件
                </label>
                <div class="layui-input-block">
                         {volist name="customer_appendix" id="vo" empty="$empty"}
                         <p>{$vo.name}&nbsp;&nbsp;<a name="download" style="color:red;cursor:pointer" data-id={$vo.id} data-name="{$vo.name}" data-type="one">下载</a></p>
                          {/volist}
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>
                <b>
                    联系人
                </b>
            </legend>
        </fieldset>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    姓名
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="title" value="{$model.title ?? ''}" placeholder="请输入获得客户时间" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    性别
                </label>
                <div class="layui-input-block">
		 			{if $model['sex'] eq 1}
		            <input type="radio" name="sex" value="0" title="男" checked disabled="">
		            <input type="radio" name="sex" value="1" title="女" disabled="">
		            {else}
		            <input type="radio" name="sex" value="0" title="男" disabled="">
		            <input type="radio" name="sex" value="1" title="女" checked disabled="">
		            {/if}
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">
                    生日
                </label>
                <div class="layui-input-inline">
                    <select name="calendar_id" disabled>
                        <option value="0" {if condition="($model.calendar_id eq 0)" }selected{/if}>阳历</option>
                        <option value="1" {if condition="($model.calendar_id eq 1)" }selected{/if}>阴历</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" value="{$model.birthday ?? ''}" id="birthday" name="birthday" placeholder="请输入生日" required="" type="text" readonly />
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    职务
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="duties"  value="{$model.duties ?? ''}"  placeholder="请输入负责人" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    称呼
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="customer_call" value="{$model.customer_call ?? ''}" placeholder="请输入称呼" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    手机号
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="customer_phone" value="{$model.customer_phone ?? ''}" placeholder="请输入手机号" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    联系人座机
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="contact_line" value="{$model.contact_line ?? ''}" placeholder="请输入联系人座机" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    邮箱
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="email" value="{$model.email ?? ''}" placeholder="请输入邮箱" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    qq
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="qq" value="{$model.qq ?? ''}" placeholder="请输入qq" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    微信号
                </label>
                <div class="layui-input-block">
                    <input autocomplete="off" class="layui-input" name="wechat" value="{$model.wechat ?? ''}" placeholder="请输入微信号" required="" type="text" readonly>
                    </input>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input id="LAY-user-back-submit" lay-filter="LAY-user-back-submit" lay-submit="" type="button" value="确认">
        </input>
    </div>
</div>
<script src="/static/admin/layui/layui.js">
</script>
<script>
	var downloadUrl = "{:url('customer/download')}";
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        treeTable: '../admin/lib/extend/authtree'
    }).use(['index', 'form', 'laydate','upload'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate ,upload = layui.upload;

     $(document).on("click", "a[name='download']", function (event) {
     var id = $(this).data('id'); //编辑
       var name = $(this).data('name'); //名称
      var param = $.param({'id': id});
     layer.confirm("确定下载"+name+"吗？", function (t) {
       	window.location.href = downloadUrl + '?' + param
       	layer.close(t);
       	return;
     });
 });
});
</script>